//
//  ASSession+Device.m
//  AppleAuth
//
//  Created by 吴双 on 2023/1/23.
//

#import "ASSession+Device.h"
#import "ASSession+Private.h"
#import <AltSign/AltSign.h>

@implementation ASTeamSession (Device)

- (void)fetchDevices:(void (^ _Nullable)(NSArray<ALTDevice *> * _Nullable devices, NSError * _Nullable error))completion {
    [[ALTAppleAPI sharedAPI] fetchDevicesForTeam:self.team session:self.session completionHandler:completion];
}

- (void)registerDeviceWithName:(NSString * _Nonnull)name
                    identifier:(NSString * _Nonnull)identifier
                     completed:(void (^_Nullable)(ALTDevice *_Nullable device, NSError *_Nullable error))completion {
    [[ALTAppleAPI sharedAPI] registerDeviceWithName:name
                                         identifier:identifier
                                               team:self.team
                                            session:self.session
                                  completionHandler:completion];
}

@end
